# 获取教程、习题、案例，共同学习、讨论、打卡
# 请关注：Crossin的编程教室
# 学习交流群：【微信】sunset24678（添加时备注：python）【QQ】群号见 https://python666.cn/c/9

for i in 'crossin':
    print(i)

# 列表继承序列方法
lst = [1, 2, 3, 4, 5]
x = lst[3]
print(x)

x = lst[1:4]
print(x)

x = 3 in lst
print(x)

x = len(lst)
print(x)

for i in lst:
    print(i)


# 字符继承序列方法
my_str = 'crossin'
x = my_str[3]
print(x)

x = my_str[1:4]
print(x)

x = 's' in my_str
print(x)

x = len(my_str)
print(x)

for c in my_str:
    print(c)

# 可变序列
lst = [1, 2, 3, 4, 5]
lst[3] = 666
print(lst)

# 容器序列
my_list = [1, 'a', 3.14, True, [1, 2, 3]]
print(my_list)

# 拼接字符串
my_list = ['a', 'b', 'c']
my_str = ''.join(my_list)
print(my_str)

my_list = ['a', 'b', 'c', 3]
my_str = ''.join(str(i) for i in my_list)
print(my_str)

# 分割字符串
my_str = 'crossin'
my_list = my_str.split('s')
print(my_list)


